package com.gpframework.framework.logging;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Random;

public class RandomStringUtils {

    public static String uniqueRandom() {
        String key = "";
        SimpleDateFormat format = new SimpleDateFormat("MMddHHmmss", Locale.getDefault());
        Date date = new Date();
        while(true){
            Random random = new Random();
            int a = random.nextInt(100);
            if (a >10) {
                key = a + format.format(date);
                Random r = new Random();
                key = key + r.nextInt();
                key = key.replace("-", "");
                key = key.substring(0, 15);
                break;
            }else{
                continue;
            }

        }
        return key;
    }
}
